package com.black.play.component.box;

import com.black.play.common.FormComponent;

import javax.swing.*;

/**
 * @author ylx
 */
public class AppInputBox extends FormComponent<JTextArea> {
    private final int row;
    private final int column;

    public AppInputBox(String label) {
        this(label, "", 3, 20);
    }

    public AppInputBox(String label, int row, int column) {
        this(label, "", row, column);
    }

    public AppInputBox(String label, String value, int row, int column) {
        super(label, value);
        this.row = row;
        this.column = column;
        this.component.setSize(row,column);
    }

    @Override
    public void initComponent() {
        this.component = new JTextArea(value, row, column);
    }

    @Override
    public String getValue() {
        return this.component.getText();
    }

    @Override
    public void setText() {
        this.component.setText(value);
    }
}
